<% layout('/layouts/default.html', {title: '游泳馆信息管理', libs: ['dataGrid']}){ %>
<div class="main-content">
	<div class="box box-main">
		<div class="box-header">
			<div class="box-title">
				<i class="fa fa-list-alt"></i> ${text('游泳馆信息管理')}
			</div>
			<div class="box-tools pull-right">
				<a href="#" class="btn btn-default" id="btnSearch" title="${text('查询')}"><i class="fa fa-filter"></i> ${text('查询')}</a>
			</div>
		</div>
		<div class="box-body">
			<#form:form id="searchForm" model="${natatoriumInfo1}" action="${ctx}/natatoriuminfo/natatoriumInfo/listTop3Data" method="post" class="form-inline hide"
					data-page-no="${parameter.pageNo}" data-page-size="${parameter.pageSize}" data-order-by="${parameter.orderBy}">
				<div class="form-group">
					<label class="control-label">${text('场馆名称')}：</label>
					<div class="control-inline">
						<#form:input path="name" maxlength="45" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<button type="submit" class="btn btn-primary btn-sm">${text('查询')}</button>
					<button type="reset" class="btn btn-default btn-sm">${text('重置')}</button>
				</div>
			</#form:form>
			<table id="dataGrid"></table>
<!-- 			<div id="dataGridPage"></div> -->
		</div>
	</div>
</div>
<% } %>
<script>
// 初始化DataGrid对象
$('#dataGrid').dataGrid({
	searchForm: $("#searchForm"),
	columnModel: [
		{header:'${text('场馆名称')}', name:'name', index:'a.name', width:150, align:"center"},
		{header:'${text('负责人')}', name:'principal', index:'a.principal', width:50, align:"center"},
		{header:'${text('联系电话')}', name:'phone', index:'a.phone', width:60, align:"center"},
		{header:'${text('场馆地址')}', name:'address', index:'a.address', width:150, align:"center"},
		{header:'${text('营业状态')}', name:'businessStatus', index:'a.business_status', width:50, align:"center", formatter: function(val, obj, row, act){
			return js.getDictLabel(${@DictUtils.getDictListJson('business_status')}, val, '${text('未知')}', true);
		}},
// 		{header:'${text('申请时间')}', name:'applyTime', index:'a.apply_time', width:150, align:"center"},
// 		{header:'${text('场馆描述')}', name:'venueDescription', index:'a.venue_description', width:150, align:"left"},
// 		{header:'${text('营业时间')}', name:'businessHours', index:'a.business_hours', width:150, align:"left"},
// 		{header:'${text('结算银行')}', name:'settlementBank', index:'a.settlement_bank', width:150, align:"left"},
// 		{header:'${text('开户人')}', name:'openAccountPerson', index:'a.open_account_person', width:150, align:"left"},
// 		{header:'${text('开户电话')}', name:'openAccountPhone', index:'a.open_account_phone', width:150, align:"left"},
// 		{header:'${text('开户帐号')}', name:'openAccountNumber', index:'a.open_account_number', width:150, align:"left"},
// 		{header:'${text('首次结算比列')}', name:'settlementFirst', index:'a.settlement_first', width:150, align:"center"},
// 		{header:'${text('最后结算比列')}', name:'settlementLast', index:'a.settlement_last', width:150, align:"center"},
		{header:'${text('状态')}', name:'status', index:'a.status', width:50, align:"center", formatter: function(val, obj, row, act){
			return js.getDictLabel(${@DictUtils.getDictListJson('sys_search_status')}, val, '${text('未知')}', true);
		}},
		{header:'${text('操作')}', name:'actions', width:320, sortable:false, title:false, align:"center", formatter: function(val, obj, row, act){
			var actions = [];
			<% if(hasPermi('natatoriuminfo:natatoriumInfo:edit')){ %>
				actions.push('<a href="${ctx}/natatoriuminfo/natatoriumInfo/form?id='+row.id+'" class="btnList btn-operation" title="${text('编辑基本信息')}">${text("基本信息")}</a>&nbsp;');
			<% } %>
				actions.push('<a href="${ctx}/natatoriuminfo/natatoriumInfo/trafficPage?id='+row.id+'" class="btn btnList btn-operation" title="访问量统计">${text("访问量统计")}</a>&nbsp;');
				actions.push('<a href="${ctx}/natatoriumgoods/natatoriumGoods/platformList?natatoriumInfoId='+row.id+'" class="btn btnList btn-operation" title="商品">${text("商品")}</a>&nbsp;');
				actions.push('<a href="${ctx}/natatoriumorder/natatoriumOrder/platformList?natatoriumInfoId='+row.id+'" class="btn btnList btn-operation" title="订单">${text("订单")}</a>&nbsp;');
				actions.push('<a href="${ctx}/settlementrecord/settlementRecord/platformList?natatoriumInfoId='+row.id+'" class="btn btnList btn-operation" title="结算记录">${text("结算记录")}</a>&nbsp;');
			<% if(hasPermi('natatoriuminfo:natatoriumInfo:edit')){ %>
				if (row.status == Global.STATUS_NORMAL){
					actions.push('<a href="${ctx}/natatoriuminfo/natatoriumInfo/disable?id='+row.id+'" class="btnList btn-operation" title="${text('停用游泳馆')}" data-confirm="${text('确认要停用该游泳馆吗？')}">${text("停用游泳馆")}</a>&nbsp;');
				}
// 				actions.push('<a href="${ctx}/natatoriuminfo/natatoriumInfo/delete?id='+row.id+'" class="btnList" title="${text('删除游泳馆信息')}" data-confirm="${text('确认要删除该游泳馆信息吗？')}"><i class="fa fa-trash-o"></i></a>&nbsp;');
			<% } %>
			return actions.join('');
		}}
	],
	// 加载成功后执行事件
	ajaxSuccess: function(data){
		
	}
});
</script>